/**
 *  Copyright (C) 2012 by Development Solutions, Software (DSS)
 *  Released under the terms of the GNU General Public license version 3 or later
 */

package org.dss.gil.view;

import javax.swing.JTabbedPane;
import org.apache.log4j.Logger;
import org.dss.gil.util.Globals;
import org.dss.gil.controller.IdeMethods;


/** 
 * This class contains the GUI for the app's Ide. In the constructor we initialize
 * the graphic components first, and after that we load the texts for every
 * graphic component according to the language specified in the configurations
 * file. The last step is create the instance for IdeMethods class who contains
 * the functionality for every element.
 * Remember: This class only must contain the events and the GUI. All the code 
 * to response to every action must be linked to a method in the class IdeMethods.
 *
 *  @author  Fernando Gil <lobho.gil@gmail.com>
 *  @since   September 2012
 *  @version 1.0
 */


public class Ide extends javax.swing.JFrame {

    private static Logger logger = Logger.getLogger(Ide.class.getName());
    private static Ide instance;
    private IdeMethods ideMethods;
    
    private Ide() {
        initComponents();
        setIconImage(Globals.logoImg);
        setLabels();
        ideMethods = IdeMethods.getInstance(this);
    }
    
    public static Ide getInstance(){
        if(instance==null){
            instance = new Ide();
        }
        return instance;
    }
    
    public void setLabels(){
        setTitle(Globals.language.getMessage("title.ide"));
        jMenuApp.setText(Globals.language.getMessage("label.menu.gil"));
        jItemHelp.setText(Globals.language.getMessage("label.item.help"));
        jItemAbout.setText(Globals.language.getMessage("label.item.about"));
        jItemPreferences.setText(Globals.language.getMessage("label.item.conf"));
        jItemKeep.setText(Globals.language.getMessage("label.item.afloat"));
        jItemExit.setText(Globals.language.getMessage("label.item.exit"));        
        
        jMenuFile.setText(Globals.language.getMessage("label.menu.file"));
        jItemNewSim.setText(Globals.language.getMessage("label.item.newSim"));
        jItemNewText.setText(Globals.language.getMessage("label.item.newText"));
        jItemOpen.setText(Globals.language.getMessage("label.item.open"));
        jItem_Save.setText(Globals.language.getMessage("label.item.save"));
        jItemSaveAs.setText(Globals.language.getMessage("label.item.saveAs"));
        jItemSaveAll.setText(Globals.language.getMessage("label.item.saveAll"));
        jItemSaveGpss.setText(Globals.language.getMessage("label.item.saveGpss"));
        //jItemRename.setText(Globals.language.getMessage("label.item.rename"));
        jItemClose.setText(Globals.language.getMessage("label.item.close"));
        jItemCloseAll.setText(Globals.language.getMessage("label.item.closeAll"));
        jItemCloseOthers.setText(Globals.language.getMessage("label.item.closeOther"));
        jItemParseGil.setText(Globals.language.getMessage("label.item.parse"));
        
        jMenuTable.setText(Globals.language.getMessage("label.menu.table"));
        jItemComments.setText(Globals.language.getMessage("label.item.show"));
        jItemUndo.setText(Globals.language.getMessage("label.item.undo"));
        jItemRedo.setText(Globals.language.getMessage("label.item.redo"));
        jItemInsertAbove.setText(Globals.language.getMessage("label.item.above"));
        jItemInsertBellow.setText(Globals.language.getMessage("label.item.bellow"));
        jItemClear.setText(Globals.language.getMessage("label.item.clear"));
        jItemDelete.setText(Globals.language.getMessage("label.item.delete"));
        jItemActivate.setText(Globals.language.getMessage("label.item.active"));
        jItemDeactivate.setText(Globals.language.getMessage("label.item.deactive"));
        jItemGoTo.setText(Globals.language.getMessage("label.item.goto"));
        jItemUp.setText(Globals.language.getMessage("label.item.up"));
        jItemDown.setText(Globals.language.getMessage("label.item.down"));
        jItemFirst.setText(Globals.language.getMessage("label.item.first"));
        jItemLast.setText(Globals.language.getMessage("label.item.last"));
        jItemCopy.setText(Globals.language.getMessage("label.item.copy"));
        jItemCut.setText(Globals.language.getMessage("label.item.cut"));
        jItemPaste.setText(Globals.language.getMessage("label.item.paste"));
        jItemSelectAll.setText(Globals.language.getMessage("label.item.all"));
        
        jMenuSim.setText(Globals.language.getMessage("label.menu.sim"));
        jmItem_RunSim.setText(Globals.language.getMessage("label.item.run"));
        
        jMenuTools.setText(Globals.language.getMessage("label.menu.tools"));
        jItemCalc.setText(Globals.language.getMessage("label.item.calc"));
        jItemFrequencies.setText(Globals.language.getMessage("label.item.freq"));
        
        jButLineCount.setText(Globals.language.getMessage("button.line"));
        jButBlockCounter.setText(Globals.language.getMessage("button.block"));
        jCheckCell.setText(Globals.language.getMessage("button.selection"));
        setToolTips();
    }

    private void setToolTips(){
        jButNewSim.setToolTipText(Globals.language.getMessage("label.item.newSim"));
        jButNewText.setToolTipText(Globals.language.getMessage("label.item.newText"));
        jButOpen.setToolTipText(Globals.language.getMessage("label.item.open"));
        jButSave.setToolTipText(Globals.language.getMessage("label.item.save"));
        jButSaveAll.setToolTipText(Globals.language.getMessage("label.item.saveAll"));
        jButSaveGpss.setToolTipText(Globals.language.getMessage("label.item.saveGpss"));
        jButClose.setToolTipText(Globals.language.getMessage("label.item.close"));
        jButCloseAll.setToolTipText(Globals.language.getMessage("label.item.closeAll"));
        jButCloseOthers.setToolTipText(Globals.language.getMessage("label.item.closeOther"));
        jButCopy.setToolTipText(Globals.language.getMessage("label.item.copy"));
        jButCut.setToolTipText(Globals.language.getMessage("label.item.cut"));
        jButPaste.setToolTipText(Globals.language.getMessage("label.item.paste"));
        jButInsertAbove.setToolTipText(Globals.language.getMessage("label.item.above"));
        jButInsertBelow.setToolTipText(Globals.language.getMessage("label.item.bellow"));
        jButClear.setToolTipText(Globals.language.getMessage("label.item.clear"));
        jButDelete.setToolTipText(Globals.language.getMessage("label.item.delete"));
        jButActive.setToolTipText(Globals.language.getMessage("label.item.active"));
        jButUp.setToolTipText(Globals.language.getMessage("label.item.up"));
        jButDown.setToolTipText(Globals.language.getMessage("label.item.down"));
        jButUndo.setToolTipText(Globals.language.getMessage("label.item.undo"));
        jButRedo.setToolTipText(Globals.language.getMessage("label.item.redo"));
        jButRun.setToolTipText(Globals.language.getMessage("label.item.run"));
    }
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jpan_Container = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        jtBar_MainBar = new javax.swing.JToolBar();
        jtBar_File = new javax.swing.JToolBar();
        jButNewSim = new javax.swing.JButton();
        jButNewText = new javax.swing.JButton();
        jButOpen = new javax.swing.JButton();
        jButSave = new javax.swing.JButton();
        jButSaveAll = new javax.swing.JButton();
        jButSaveGpss = new javax.swing.JButton();
        jButClose = new javax.swing.JButton();
        jButCloseAll = new javax.swing.JButton();
        jButCloseOthers = new javax.swing.JButton();
        jtBar_TableAction = new javax.swing.JToolBar();
        jButRun = new javax.swing.JButton();
        jButUndo = new javax.swing.JButton();
        jButRedo = new javax.swing.JButton();
        jButInsertAbove = new javax.swing.JButton();
        jButInsertBelow = new javax.swing.JButton();
        jButDelete = new javax.swing.JButton();
        jButClear = new javax.swing.JButton();
        jButActive = new javax.swing.JButton();
        jButUp = new javax.swing.JButton();
        jButDown = new javax.swing.JButton();
        jButCopy = new javax.swing.JButton();
        jButCut = new javax.swing.JButton();
        jButPaste = new javax.swing.JButton();
        jtBar_Status = new javax.swing.JToolBar();
        jCheckCell = new javax.swing.JCheckBox();
        jButLineCount = new javax.swing.JButton();
        jButBlockCounter = new javax.swing.JButton();
        jtPan_Files = new javax.swing.JTabbedPane();
        jMenubar = new javax.swing.JMenuBar();
        jMenuApp = new javax.swing.JMenu();
        jItemHelp = new javax.swing.JMenuItem();
        jItemAbout = new javax.swing.JMenuItem();
        jItemPreferences = new javax.swing.JMenuItem();
        jItemKeep = new javax.swing.JMenuItem();
        jItemExit = new javax.swing.JMenuItem();
        jMenuFile = new javax.swing.JMenu();
        jItemNewSim = new javax.swing.JMenuItem();
        jItemNewText = new javax.swing.JMenuItem();
        jItemOpen = new javax.swing.JMenuItem();
        jItem_Save = new javax.swing.JMenuItem();
        jItemSaveAs = new javax.swing.JMenuItem();
        jItemSaveAll = new javax.swing.JMenuItem();
        jItemSaveGpss = new javax.swing.JMenuItem();
        jItemParseGil = new javax.swing.JMenuItem();
        jItemClose = new javax.swing.JMenuItem();
        jItemCloseAll = new javax.swing.JMenuItem();
        jItemCloseOthers = new javax.swing.JMenuItem();
        jMenuTable = new javax.swing.JMenu();
        jItemUndo = new javax.swing.JMenuItem();
        jItemRedo = new javax.swing.JMenuItem();
        jItemActivate = new javax.swing.JMenuItem();
        jItemDeactivate = new javax.swing.JMenuItem();
        jItemDelete = new javax.swing.JMenuItem();
        jItemInsertAbove = new javax.swing.JMenuItem();
        jItemInsertBellow = new javax.swing.JMenuItem();
        jItemClear = new javax.swing.JMenuItem();
        jItemSelectAll = new javax.swing.JMenuItem();
        jItemGoTo = new javax.swing.JMenuItem();
        jItemFirst = new javax.swing.JMenuItem();
        jItemLast = new javax.swing.JMenuItem();
        jItemUp = new javax.swing.JMenuItem();
        jItemDown = new javax.swing.JMenuItem();
        jItemCopy = new javax.swing.JMenuItem();
        jItemCut = new javax.swing.JMenuItem();
        jItemPaste = new javax.swing.JMenuItem();
        jMenuSim = new javax.swing.JMenu();
        jItemComments = new javax.swing.JMenuItem();
        jmItem_RunSim = new javax.swing.JMenuItem();
        jMenuTools = new javax.swing.JMenu();
        jItemCalc = new javax.swing.JMenuItem();
        jItemFrequencies = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        jSeparator1.setBackground(new java.awt.Color(238, 238, 238));

        jtBar_MainBar.setFloatable(false);
        jtBar_MainBar.setRollover(true);

        jtBar_File.setRollover(true);

        jButNewSim.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/block_x24.png"))); // NOI18N
        jButNewSim.setToolTipText("New Simulation");
        jButNewSim.setFocusable(false);
        jButNewSim.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButNewSim.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButNewSim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButNewSimActionPerformed(evt);
            }
        });
        jtBar_File.add(jButNewSim);

        jButNewText.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/File_x24.png"))); // NOI18N
        jButNewText.setToolTipText("New Text File");
        jButNewText.setFocusable(false);
        jButNewText.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButNewText.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButNewText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButNewTextActionPerformed(evt);
            }
        });
        jtBar_File.add(jButNewText);

        jButOpen.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/open_green_x24.png"))); // NOI18N
        jButOpen.setToolTipText("Open");
        jButOpen.setFocusable(false);
        jButOpen.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButOpen.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButOpenActionPerformed(evt);
            }
        });
        jtBar_File.add(jButOpen);

        jButSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/save_x24.png"))); // NOI18N
        jButSave.setToolTipText("Save");
        jButSave.setFocusable(false);
        jButSave.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButSave.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButSaveActionPerformed(evt);
            }
        });
        jtBar_File.add(jButSave);

        jButSaveAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/save_all_x24.png"))); // NOI18N
        jButSaveAll.setToolTipText("Save All");
        jButSaveAll.setFocusable(false);
        jButSaveAll.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButSaveAll.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButSaveAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButSaveAllActionPerformed(evt);
            }
        });
        jtBar_File.add(jButSaveAll);

        jButSaveGpss.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/save_copy_x24.png"))); // NOI18N
        jButSaveGpss.setToolTipText("Save Copy");
        jButSaveGpss.setFocusable(false);
        jButSaveGpss.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButSaveGpss.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButSaveGpss.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButSaveGpssActionPerformed(evt);
            }
        });
        jtBar_File.add(jButSaveGpss);

        jButClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/close_24.png"))); // NOI18N
        jButClose.setToolTipText("Close");
        jButClose.setFocusable(false);
        jButClose.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButClose.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButCloseActionPerformed(evt);
            }
        });
        jtBar_File.add(jButClose);

        jButCloseAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/close_all_x24.png"))); // NOI18N
        jButCloseAll.setToolTipText("Close All");
        jButCloseAll.setFocusable(false);
        jButCloseAll.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButCloseAll.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButCloseAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButCloseAllActionPerformed(evt);
            }
        });
        jtBar_File.add(jButCloseAll);

        jButCloseOthers.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/close_others_x24.png"))); // NOI18N
        jButCloseOthers.setToolTipText("Close Others");
        jButCloseOthers.setFocusable(false);
        jButCloseOthers.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButCloseOthers.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButCloseOthers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButCloseOthersActionPerformed(evt);
            }
        });
        jtBar_File.add(jButCloseOthers);

        jtBar_MainBar.add(jtBar_File);

        jtBar_TableAction.setRollover(true);

        jButRun.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/runSimx24.png"))); // NOI18N
        jButRun.setToolTipText("Close Others");
        jButRun.setEnabled(false);
        jButRun.setFocusable(false);
        jButRun.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButRun.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButRun.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButRunActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButRun);

        jButUndo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/agt_back.png"))); // NOI18N
        jButUndo.setToolTipText("Move First");
        jButUndo.setEnabled(false);
        jButUndo.setFocusable(false);
        jButUndo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButUndo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButUndo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButUndoActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButUndo);

        jButRedo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/agt_forward.png"))); // NOI18N
        jButRedo.setToolTipText("Move Last");
        jButRedo.setEnabled(false);
        jButRedo.setFocusable(false);
        jButRedo.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButRedo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButRedo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButRedoActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButRedo);

        jButInsertAbove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/add_row_x24.png"))); // NOI18N
        jButInsertAbove.setToolTipText("Insert Row Bellow");
        jButInsertAbove.setEnabled(false);
        jButInsertAbove.setFocusable(false);
        jButInsertAbove.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButInsertAbove.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButInsertAbove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButInsertAboveActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButInsertAbove);

        jButInsertBelow.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/add_rows_x24.png"))); // NOI18N
        jButInsertBelow.setToolTipText("Insert Rows Bellow");
        jButInsertBelow.setEnabled(false);
        jButInsertBelow.setFocusable(false);
        jButInsertBelow.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButInsertBelow.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButInsertBelow.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButInsertBelowActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButInsertBelow);

        jButDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/remove_rows_x24.png"))); // NOI18N
        jButDelete.setToolTipText("Delete Rows");
        jButDelete.setEnabled(false);
        jButDelete.setFocusable(false);
        jButDelete.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButDelete.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButDeleteActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButDelete);

        jButClear.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/clear_rows_x24.png"))); // NOI18N
        jButClear.setToolTipText("Clear Rows");
        jButClear.setEnabled(false);
        jButClear.setFocusable(false);
        jButClear.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButClear.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButClear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButClearActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButClear);

        jButActive.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/activate_rows_x24.png"))); // NOI18N
        jButActive.setToolTipText("Active Rows");
        jButActive.setEnabled(false);
        jButActive.setFocusable(false);
        jButActive.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButActive.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButActive.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButActiveActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButActive);

        jButUp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/up_x24.png"))); // NOI18N
        jButUp.setToolTipText("Move Up");
        jButUp.setEnabled(false);
        jButUp.setFocusable(false);
        jButUp.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButUp.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButUp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButUpActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButUp);

        jButDown.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/down_x24.png"))); // NOI18N
        jButDown.setToolTipText("Move Down");
        jButDown.setEnabled(false);
        jButDown.setFocusable(false);
        jButDown.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButDown.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButDownActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButDown);

        jButCopy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/editcopy_x24.png"))); // NOI18N
        jButCopy.setToolTipText("Copy Row");
        jButCopy.setEnabled(false);
        jButCopy.setFocusable(false);
        jButCopy.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButCopy.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButCopy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButCopyActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButCopy);

        jButCut.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/editcut_x24.png"))); // NOI18N
        jButCut.setToolTipText("Cut Row");
        jButCut.setEnabled(false);
        jButCut.setFocusable(false);
        jButCut.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButCut.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButCutActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButCut);

        jButPaste.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/dss/gil/view/img/editpaste_x24.png"))); // NOI18N
        jButPaste.setToolTipText("Paste Row");
        jButPaste.setEnabled(false);
        jButPaste.setFocusable(false);
        jButPaste.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButPaste.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButPaste.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButPasteActionPerformed(evt);
            }
        });
        jtBar_TableAction.add(jButPaste);

        jtBar_MainBar.add(jtBar_TableAction);

        jtBar_Status.setFloatable(false);
        jtBar_Status.setRollover(true);
        jtBar_Status.setEnabled(false);

        jCheckCell.setSelected(true);
        jCheckCell.setText("Cell Selection");
        jCheckCell.setEnabled(false);
        jCheckCell.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckCellActionPerformed(evt);
            }
        });
        jtBar_Status.add(jCheckCell);

        jButLineCount.setText("Line #:");
        jButLineCount.setFocusable(false);
        jButLineCount.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButLineCount.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jtBar_Status.add(jButLineCount);

        jButBlockCounter.setText("Block #:");
        jButBlockCounter.setFocusable(false);
        jButBlockCounter.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButBlockCounter.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jtBar_Status.add(jButBlockCounter);

        jtPan_Files.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);
        jtPan_Files.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jtPan_FilesStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jpan_ContainerLayout = new javax.swing.GroupLayout(jpan_Container);
        jpan_Container.setLayout(jpan_ContainerLayout);
        jpan_ContainerLayout.setHorizontalGroup(
            jpan_ContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 832, Short.MAX_VALUE)
            .addComponent(jtBar_Status, javax.swing.GroupLayout.DEFAULT_SIZE, 832, Short.MAX_VALUE)
            .addGroup(jpan_ContainerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jtPan_Files, javax.swing.GroupLayout.DEFAULT_SIZE, 806, Short.MAX_VALUE)
                .addContainerGap())
            .addComponent(jtBar_MainBar, javax.swing.GroupLayout.DEFAULT_SIZE, 832, Short.MAX_VALUE)
        );
        jpan_ContainerLayout.setVerticalGroup(
            jpan_ContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpan_ContainerLayout.createSequentialGroup()
                .addComponent(jtBar_MainBar, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jtPan_Files, javax.swing.GroupLayout.DEFAULT_SIZE, 378, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtBar_Status, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jMenuApp.setText("app");

        jItemHelp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
        jItemHelp.setText("help");
        jItemHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemHelpActionPerformed(evt);
            }
        });
        jMenuApp.add(jItemHelp);

        jItemAbout.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F2, 0));
        jItemAbout.setText("about");
        jItemAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemAboutActionPerformed(evt);
            }
        });
        jMenuApp.add(jItemAbout);

        jItemPreferences.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F3, 0));
        jItemPreferences.setText("config");
        jItemPreferences.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemPreferencesActionPerformed(evt);
            }
        });
        jMenuApp.add(jItemPreferences);

        jItemKeep.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, 0));
        jItemKeep.setText("keep");
        jItemKeep.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemKeepActionPerformed(evt);
            }
        });
        jMenuApp.add(jItemKeep);

        jItemExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        jItemExit.setText("exit");
        jItemExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemExitActionPerformed(evt);
            }
        });
        jMenuApp.add(jItemExit);

        jMenubar.add(jMenuApp);

        jMenuFile.setText("file");

        jItemNewSim.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jItemNewSim.setText("new simulation");
        jItemNewSim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemNewSimActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemNewSim);

        jItemNewText.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK));
        jItemNewText.setText("new text file");
        jItemNewText.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemNewTextActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemNewText);

        jItemOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jItemOpen.setText("open");
        jItemOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemOpenActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemOpen);

        jItem_Save.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        jItem_Save.setText("save");
        jItem_Save.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItem_SaveActionPerformed(evt);
            }
        });
        jMenuFile.add(jItem_Save);

        jItemSaveAs.setText("save as");
        jItemSaveAs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemSaveAsActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemSaveAs);

        jItemSaveAll.setText("save all");
        jItemSaveAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemSaveAllActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemSaveAll);

        jItemSaveGpss.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK));
        jItemSaveGpss.setText("save as gpssh");
        jItemSaveGpss.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemSaveGpssActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemSaveGpss);

        jItemParseGil.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jItemParseGil.setText("parse gpss to gil");
        jItemParseGil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemParseGilActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemParseGil);

        jItemClose.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK));
        jItemClose.setText("close");
        jItemClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCloseActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemClose);

        jItemCloseAll.setText("close all");
        jItemCloseAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCloseAllActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemCloseAll);

        jItemCloseOthers.setText("close others");
        jItemCloseOthers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCloseOthersActionPerformed(evt);
            }
        });
        jMenuFile.add(jItemCloseOthers);

        jMenubar.add(jMenuFile);

        jMenuTable.setText("table");
        jMenuTable.setEnabled(false);

        jItemUndo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemUndo.setText("undo");
        jItemUndo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemUndoActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemUndo);

        jItemRedo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemRedo.setText("redo");
        jItemRedo.setEnabled(false);
        jItemRedo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemRedoActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemRedo);

        jItemActivate.setText("activate");
        jItemActivate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemActivateActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemActivate);

        jItemDeactivate.setText("deactivate");
        jItemDeactivate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemDeactivateActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemDeactivate);

        jItemDelete.setText("delete");
        jItemDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemDeleteActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemDelete);

        jItemInsertAbove.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemInsertAbove.setText("above");
        jItemInsertAbove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemInsertAboveActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemInsertAbove);

        jItemInsertBellow.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemInsertBellow.setText("below");
        jItemInsertBellow.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemInsertBellowActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemInsertBellow);

        jItemClear.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemClear.setText("clear");
        jItemClear.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemClearActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemClear);

        jItemSelectAll.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemSelectAll.setText("select all");
        jItemSelectAll.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemSelectAllActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemSelectAll);

        jItemGoTo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemGoTo.setText("go to");
        jItemGoTo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemGoToActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemGoTo);

        jItemFirst.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemFirst.setText("first");
        jItemFirst.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemFirstActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemFirst);

        jItemLast.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemLast.setText("last");
        jItemLast.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemLastActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemLast);

        jItemUp.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemUp.setText("up");
        jItemUp.setAutoscrolls(true);
        jItemUp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemUpActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemUp);

        jItemDown.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemDown.setText("down");
        jItemDown.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemDownActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemDown);

        jItemCopy.setText("copy");
        jItemCopy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCopyActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemCopy);

        jItemCut.setText("cut");
        jItemCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCutActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemCut);

        jItemPaste.setText("paste");
        jItemPaste.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemPasteActionPerformed(evt);
            }
        });
        jMenuTable.add(jItemPaste);

        jMenubar.add(jMenuTable);

        jMenuSim.setText("simulation");
        jMenuSim.setEnabled(false);

        jItemComments.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemComments.setText("show comments");
        jItemComments.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCommentsActionPerformed(evt);
            }
        });
        jMenuSim.add(jItemComments);

        jmItem_RunSim.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jmItem_RunSim.setText("run");
        jmItem_RunSim.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmItem_RunSimActionPerformed(evt);
            }
        });
        jMenuSim.add(jmItem_RunSim);

        jMenuTools.setText("tools");

        jItemCalc.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemCalc.setText("calc");
        jItemCalc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemCalcActionPerformed(evt);
            }
        });
        jMenuTools.add(jItemCalc);

        jItemFrequencies.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jItemFrequencies.setText("prob");
        jItemFrequencies.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jItemFrequenciesActionPerformed(evt);
            }
        });
        jMenuTools.add(jItemFrequencies);

        jMenuSim.add(jMenuTools);

        jMenubar.add(jMenuSim);

        setJMenuBar(jMenubar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpan_Container, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpan_Container, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
    ideMethods.exit();
}//GEN-LAST:event_formWindowClosing

private void jCheckCellActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckCellActionPerformed
    ideMethods.setCellSelection(jtPan_Files.getSelectedComponent(),jCheckCell.isSelected());
}//GEN-LAST:event_jCheckCellActionPerformed

private void jItemHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemHelpActionPerformed
    ideMethods.loadHelpWindow();
}//GEN-LAST:event_jItemHelpActionPerformed

private void jItemAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemAboutActionPerformed
    ideMethods.loadAboutWindow();
}//GEN-LAST:event_jItemAboutActionPerformed

private void jItemPreferencesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemPreferencesActionPerformed
    ideMethods.loadConfigurationsWindow();
}//GEN-LAST:event_jItemPreferencesActionPerformed

private void jItemKeepActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemKeepActionPerformed
    ideMethods.keepAfloat();
}//GEN-LAST:event_jItemKeepActionPerformed

private void jItemExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemExitActionPerformed
    ideMethods.exit();
}//GEN-LAST:event_jItemExitActionPerformed

private void jItemNewSimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemNewSimActionPerformed
    ideMethods.createNewSimulationFile();
}//GEN-LAST:event_jItemNewSimActionPerformed

private void jButNewSimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButNewSimActionPerformed
    ideMethods.createNewSimulationFile();
}//GEN-LAST:event_jButNewSimActionPerformed

private void jtPan_FilesStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jtPan_FilesStateChanged
    boolean active = ( jtPan_Files.getSelectedComponent() instanceof TablePanel);
    //activate for table panel
    jMenuSim.setEnabled(active);
    jMenuTable.setEnabled(active);
    jButRun.setEnabled(active);
    jButUndo.setEnabled(active);
    jButRedo.setEnabled(active);
    jButInsertAbove.setEnabled(active);
    jButInsertBelow.setEnabled(active);
    jButDelete.setEnabled(active);
    jButClear.setEnabled(active);
    jButActive.setEnabled(active);
    jButUp.setEnabled(active);
    jButDown.setEnabled(active);
    jButCopy.setEnabled(active);
    jButCut.setEnabled(active);
    jButPaste.setEnabled(active);
    jCheckCell.setEnabled(active);
    jItemSaveGpss.setEnabled(active);
    jButSaveGpss.setEnabled(active);
    //activate for text panel
    jItemParseGil.setEnabled(!active);
}//GEN-LAST:event_jtPan_FilesStateChanged

private void jItemNewTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemNewTextActionPerformed
    ideMethods.createNewTextFile();
}//GEN-LAST:event_jItemNewTextActionPerformed

private void jButNewTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButNewTextActionPerformed
    ideMethods.createNewTextFile();
}//GEN-LAST:event_jButNewTextActionPerformed

private void jItemOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemOpenActionPerformed
    ideMethods.openFileOrSelectIfExist();
}//GEN-LAST:event_jItemOpenActionPerformed

private void jButOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButOpenActionPerformed
    ideMethods.openFileOrSelectIfExist();
}//GEN-LAST:event_jButOpenActionPerformed

private void jButSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButSaveActionPerformed
    ideMethods.save(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButSaveActionPerformed

private void jItem_SaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItem_SaveActionPerformed
    ideMethods.save(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItem_SaveActionPerformed

private void jItemSaveAsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemSaveAsActionPerformed
    ideMethods.saveAs(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemSaveAsActionPerformed

private void jItemSaveAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemSaveAllActionPerformed
    ideMethods.saveAll();
}//GEN-LAST:event_jItemSaveAllActionPerformed

private void jButSaveAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButSaveAllActionPerformed
    ideMethods.saveAll();
}//GEN-LAST:event_jButSaveAllActionPerformed

private void jButSaveGpssActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButSaveGpssActionPerformed
    ideMethods.saveAsGpsshFile(jtPan_Files.getSelectedComponent());   
}//GEN-LAST:event_jButSaveGpssActionPerformed

private void jItemSaveGpssActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemSaveGpssActionPerformed
    ideMethods.saveAsGpsshFile(jtPan_Files.getSelectedComponent());   
}//GEN-LAST:event_jItemSaveGpssActionPerformed

private void jItemCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCloseActionPerformed
    ideMethods.close(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemCloseActionPerformed

private void jButCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButCloseActionPerformed
    ideMethods.close(this.jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButCloseActionPerformed

private void jItemCloseAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCloseAllActionPerformed
    ideMethods.closeAll();
}//GEN-LAST:event_jItemCloseAllActionPerformed

private void jButCloseAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButCloseAllActionPerformed
    ideMethods.closeAll();
}//GEN-LAST:event_jButCloseAllActionPerformed

private void jItemCloseOthersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCloseOthersActionPerformed
    ideMethods.closeOthers();
}//GEN-LAST:event_jItemCloseOthersActionPerformed

private void jButCloseOthersActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButCloseOthersActionPerformed
    ideMethods.closeOthers();
}//GEN-LAST:event_jButCloseOthersActionPerformed

private void jItemUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemUndoActionPerformed
    try{
       ideMethods.undo(jtPan_Files.getSelectedComponent());
    }catch(Exception ex){
        logger.error(ex.getMessage());
    }
}//GEN-LAST:event_jItemUndoActionPerformed

private void jButUndoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButUndoActionPerformed
    ideMethods.undo(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButUndoActionPerformed

private void jItemRedoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemRedoActionPerformed
    ideMethods.redo(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemRedoActionPerformed

private void jButRedoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButRedoActionPerformed
    ideMethods.redo(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButRedoActionPerformed

private void jItemInsertAboveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemInsertAboveActionPerformed
    ideMethods.insertRowsAbove(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemInsertAboveActionPerformed

private void jButInsertAboveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButInsertAboveActionPerformed
    ideMethods.insertRowsAbove(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButInsertAboveActionPerformed

private void jItemInsertBellowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemInsertBellowActionPerformed
    ideMethods.insertRowsBellow(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemInsertBellowActionPerformed

private void jButInsertBelowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButInsertBelowActionPerformed
    ideMethods.insertRowsBellow(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButInsertBelowActionPerformed

private void jItemDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemDeleteActionPerformed
    ideMethods.deleteRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemDeleteActionPerformed

private void jButDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButDeleteActionPerformed
    ideMethods.deleteRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButDeleteActionPerformed

private void jItemClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemClearActionPerformed
    ideMethods.clearRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemClearActionPerformed

private void jButClearActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButClearActionPerformed
    ideMethods.clearRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButClearActionPerformed

private void jItemActivateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemActivateActionPerformed
    ideMethods.activeRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemActivateActionPerformed

private void jButActiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButActiveActionPerformed
    ideMethods.activeRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButActiveActionPerformed

private void jItemDeactivateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemDeactivateActionPerformed
    ideMethods.deactiveRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemDeactivateActionPerformed

private void jItemGoToActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemGoToActionPerformed
    ideMethods.goToRow(this.jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemGoToActionPerformed

private void jItemUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemUpActionPerformed
    ideMethods.moveUp(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemUpActionPerformed

private void jButUpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButUpActionPerformed
    ideMethods.moveUp(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButUpActionPerformed

private void jItemDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemDownActionPerformed
    ideMethods.moveDown(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemDownActionPerformed

private void jButDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButDownActionPerformed
    ideMethods.moveDown(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButDownActionPerformed

private void jItemFirstActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemFirstActionPerformed
    ideMethods.moveFirst(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemFirstActionPerformed

private void jItemLastActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemLastActionPerformed
    ideMethods.moveLast(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemLastActionPerformed

private void jItemCopyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCopyActionPerformed
    ideMethods.copyRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemCopyActionPerformed

private void jButCopyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButCopyActionPerformed
    ideMethods.copyRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButCopyActionPerformed

private void jItemCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCutActionPerformed
    ideMethods.cutRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemCutActionPerformed

private void jButCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButCutActionPerformed
    ideMethods.cutRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButCutActionPerformed

private void jItemPasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemPasteActionPerformed
    ideMethods.pasteRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemPasteActionPerformed

private void jButPasteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButPasteActionPerformed
    ideMethods.pasteRows(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButPasteActionPerformed

private void jItemSelectAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemSelectAllActionPerformed
    ideMethods.selectAll(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemSelectAllActionPerformed

private void jItemCommentsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCommentsActionPerformed
    ideMethods.showComments(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemCommentsActionPerformed

private void jmItem_RunSimActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmItem_RunSimActionPerformed
    ideMethods.runSimulation(this.jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jmItem_RunSimActionPerformed

private void jButRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButRunActionPerformed
    ideMethods.runSimulation(this.jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jButRunActionPerformed

private void jItemCalcActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemCalcActionPerformed
    ideMethods.loadCalc();
}//GEN-LAST:event_jItemCalcActionPerformed

private void jItemFrequenciesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemFrequenciesActionPerformed
    ideMethods.loadFrequencies();
}//GEN-LAST:event_jItemFrequenciesActionPerformed

private void jItemParseGilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jItemParseGilActionPerformed
    ideMethods.parseGpssToGil(jtPan_Files.getSelectedComponent());
}//GEN-LAST:event_jItemParseGilActionPerformed

public JTabbedPane getTabPane(){
    return jtPan_Files;
}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButActive;
    public javax.swing.JButton jButBlockCounter;
    private javax.swing.JButton jButClear;
    private javax.swing.JButton jButClose;
    private javax.swing.JButton jButCloseAll;
    private javax.swing.JButton jButCloseOthers;
    private javax.swing.JButton jButCopy;
    private javax.swing.JButton jButCut;
    private javax.swing.JButton jButDelete;
    private javax.swing.JButton jButDown;
    private javax.swing.JButton jButInsertAbove;
    private javax.swing.JButton jButInsertBelow;
    public javax.swing.JButton jButLineCount;
    private javax.swing.JButton jButNewSim;
    private javax.swing.JButton jButNewText;
    private javax.swing.JButton jButOpen;
    private javax.swing.JButton jButPaste;
    public javax.swing.JButton jButRedo;
    private javax.swing.JButton jButRun;
    private javax.swing.JButton jButSave;
    private javax.swing.JButton jButSaveAll;
    private javax.swing.JButton jButSaveGpss;
    public javax.swing.JButton jButUndo;
    private javax.swing.JButton jButUp;
    private javax.swing.JCheckBox jCheckCell;
    private javax.swing.JMenuItem jItemAbout;
    private javax.swing.JMenuItem jItemActivate;
    private javax.swing.JMenuItem jItemCalc;
    private javax.swing.JMenuItem jItemClear;
    private javax.swing.JMenuItem jItemClose;
    private javax.swing.JMenuItem jItemCloseAll;
    private javax.swing.JMenuItem jItemCloseOthers;
    private javax.swing.JMenuItem jItemComments;
    private javax.swing.JMenuItem jItemCopy;
    private javax.swing.JMenuItem jItemCut;
    private javax.swing.JMenuItem jItemDeactivate;
    private javax.swing.JMenuItem jItemDelete;
    private javax.swing.JMenuItem jItemDown;
    private javax.swing.JMenuItem jItemExit;
    private javax.swing.JMenuItem jItemFirst;
    private javax.swing.JMenuItem jItemFrequencies;
    private javax.swing.JMenuItem jItemGoTo;
    private javax.swing.JMenuItem jItemHelp;
    private javax.swing.JMenuItem jItemInsertAbove;
    private javax.swing.JMenuItem jItemInsertBellow;
    private javax.swing.JMenuItem jItemKeep;
    private javax.swing.JMenuItem jItemLast;
    private javax.swing.JMenuItem jItemNewSim;
    private javax.swing.JMenuItem jItemNewText;
    private javax.swing.JMenuItem jItemOpen;
    private javax.swing.JMenuItem jItemParseGil;
    private javax.swing.JMenuItem jItemPaste;
    private javax.swing.JMenuItem jItemPreferences;
    public javax.swing.JMenuItem jItemRedo;
    private javax.swing.JMenuItem jItemSaveAll;
    private javax.swing.JMenuItem jItemSaveAs;
    private javax.swing.JMenuItem jItemSaveGpss;
    private javax.swing.JMenuItem jItemSelectAll;
    public javax.swing.JMenuItem jItemUndo;
    private javax.swing.JMenuItem jItemUp;
    private javax.swing.JMenuItem jItem_Save;
    private javax.swing.JMenu jMenuApp;
    private javax.swing.JMenu jMenuFile;
    private javax.swing.JMenu jMenuSim;
    private javax.swing.JMenu jMenuTable;
    private javax.swing.JMenu jMenuTools;
    private javax.swing.JMenuBar jMenubar;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JMenuItem jmItem_RunSim;
    private javax.swing.JPanel jpan_Container;
    private javax.swing.JToolBar jtBar_File;
    private javax.swing.JToolBar jtBar_MainBar;
    private javax.swing.JToolBar jtBar_Status;
    private javax.swing.JToolBar jtBar_TableAction;
    public javax.swing.JTabbedPane jtPan_Files;
    // End of variables declaration//GEN-END:variables

}
